{% extends "help/index.html" %}


{% block contentblock %}
    <div class="article">
        <div class="title">
            <div class="title-text">查询用户的资源访问权限<span
                    class="update-time"><i>更新时间:</i><i>2019-11-20</i></span></div>
        </div>
        <div class="content">
            <h2>查询用户的资源访问权限</h2>
            <h3>接口</h3>
            <code>/baidu_dueros/check_video_permission</code>
            <h5 id="参数">参数</h5>
            <table>
                <thead>
                <th>位置</th>
                <th>字段名</th>
                <th>类型</th>
                <th>是否必填</th>
                <th>描述</th>
                <th>备注</th>
                </thead>
                <tbody>
                <tr>
                    <td>http header</td>
                    <td>Authorization</td>
                    <td>String</td>
                    <td>是</td>
                    <td>Bearer + 空格 + 生成的用户access token</td>
                    <td></td>
                </tr>
                <tr>
                    <td>http body</td>
                    <td>resourceIds[].albumId</td>
                    <td>String</td>
                    <td>是</td>
                    <td>专辑ID</td>
                    <td></td>
                </tr>
                </tbody>
            </table>
            <h4 id="返回值">返回值</h4>
            <table>
                <thead>
                <th>字段名</th>
                <th>类型</th>
                <th>必填</th>
                <th>描述</th>
                </thead>
                <tbody>
                <tr>
                    <td>errno</td>
                    <td>int</td>
                    <td>是</td>
                    <td>错误码</td>
                </tr>
                <tr>
                    <td>message</td>
                    <td>String</td>
                    <td>是</td>
                    <td>接口返回状态的描述信息</td>
                </tr>
                <tr>
                    <td>data</td>
                    <td>String</td>
                    <td>是</td>
                    <td>内容json</td>
                </tr>
                <tr>
                    <td>data.isLogin</td>
                    <td>int</td>
                    <td>是</td>
                    <td>1为用户已登录，0为未登录（没有token或token过期、失效等）</td>
                </tr>
                <tr>
                    <td>data.resource[].albumId</td>
                    <td>String</td>
                    <td>是</td>
                    <td>专辑ID</td>
                </tr>
                <tr>
                    <td>data.resource[].contentId</td>
                    <td>String</td>
                    <td>是</td>
                    <td>资源ID，同专辑ID</td>
                </tr>
                <tr>
                    <td>data.resource[].price</td>
                    <td>int</td>
                    <td>是</td>
                    <td>资源价格，单位分</td>
                </tr>
                <tr>
                    <td>data.resource[].discounted_price</td>
                    <td>int</td>
                    <td>是</td>
                    <td>资源折扣价格，单位分</td>
                </tr>
                <tr>
                    <td>data.resource[].tag</td>
                    <td>String</td>
                    <td>是</td>
                    <td>资源展示标签，不超过4个汉字，可以为空</td>
                </tr>
                <tr>
                    <td>data.resource[].isPaid</td>
                    <td>int</td>
                    <td>是</td>
                    <td>1为用户已付费，0为未付费</td>
                </tr>
                </tbody>
            </table>
            <h4 id="实例">实例</h4>
            <pre><code>
curl --dump-header - -H "Authorization: Bearer baidu" -H "Accept: application/json" -H "Content-Type: application/json" -X POST --data "{\"resourceIds\":[{\"albumId\":\"12002\", \"contentId\":\"\"}],\"VipName\":\"\"}" https://wweb.yourhost.com/baidu_dueros/check_video_permission
-- 免费
curl --dump-header - -H "Authorization: Bearer Rj9tsh2nmHRupXckxBCTAM3sPbUgdA" -H "Accept: application/json" -H "Content-Type: application/json" -X POST --data "{\"resourceIds\":[{\"albumId\":\"12002\", \"contentId\":\"\"}],\"VipName\":\"\"}" https://wweb.yourhost.com/baidu_dueros/check_video_permission
-- 收费
curl --dump-header - -H "Authorization: Bearer Rj9tsh2nmHRupXckxBCTAM3sPbUgdA" -H "Accept: application/json" -H "Content-Type: application/json" -X POST --data "{\"resourceIds\":[{\"albumId\":\"12002\", \"contentId\":\"\"}],\"VipName\":\"\"}" https://wweb.yourhost.com/baidu_dueros/check_video_permission
{
    "errno": "0",
    "data": {
        "isLogin": 0,
        "resource": [
            {
                "isPaid": 0,
                "discounted_price": 1,
                "contentId": "12002",
                "price": 1,
                "albumId": "12",
                "tag": ""
            }
        ]
    }
}
            </code></pre>
        </div>
    </div>
{% endblock contentblock %}